﻿#pragma once
#include "DmToolDlg.h"
//
#include "Cdmsoft.h"
#include "AllocateDM.h"
#include <map>
using namespace std;
extern Cdmsoft *m_GlobalDM;//全局大漠
extern Cdmsoft* g_pDmTool;
extern Cdmsoft* g_pDmLD;
extern CString arrsAction[5];
extern CString arrsType[5];
extern CString arrTask[3];
extern map<CString, int> mapTask;
extern map<CString, int> mapocr;
extern map<CString, OcrDetail> mapOcrDetail;
extern map<CString, OcrDetail>ocrMap;
extern Range range;
extern VARIANT _x, _y;
extern CString sTimeBmp;
void SplitStr(CString strSrc, CString strGap, CStringArray &strResult);
void addArr(INT* nlist);

int SplitVARIANT(CString strSrc, VARIANT* nlist, CString division);

void randMove(long x, long y);

long randNum(int n);

bool runScript(CString str);

//转字符指针(参数CString类型)[返回:char*]
const char* StrP(CString x);
CString Str(const char * x);
//转字符串(整数)[返回:CSring]
CString Str(int x);
//转字符串(长整数)[返回:CSring]
CString Str(long x);
//转字符串(句柄)[返回:转换后的字符串]
CString Str(HWND x);
//转窗口句柄(窗口对象指针)[窗口句柄]
HWND hWnd(CWnd * wnd);
//转窗口对象指针(窗口句柄)[窗口对象指针]
CWnd *wnd(HWND hWnd);
//转CSring(参数HANDLE类型)[返回:CSring]
CString Str(HANDLE x);
//转CSring(参数DWORD类型)[返回:CSring]
CString Str(DWORD x);
//转CSring(参数BSTR类型)[返回:CSring]
CString Str(BSTR s);
//转Bstr(参数cstring类型)[返回:Bstr]
BSTR StrBstr(CString s);
//转Bstr(参数cahr*类型)[返回:Bstr]
BSTR StrBstr(char *x);
//转长整数(VARIANT变参指针)[返回:long]
long  lVal(VARIANT x);
//转长整数(CString字符串)[返回:long]
long  lVal(CString x);
//转整数(CString字符串)[返回:int]
int  iVal(CString x);
//转长整数(字符数组或指针)[返回:long]
long lVal(char *s);
//16进制字符串(长整数)[返回:CString]
CString Hex(long Data);
//转十进制(CString)[返回:long]
long ChangeNum(CString str);


//
//
//#define ConfigFile  _T("C://MobileGame//Config.ini")
//#define AccountFile _T("C://MobileGame//Account.ini")
//#define RoleNameFile _T("C://MobileGame//RoleName.ini") //角色名称记录
//#define MoneyFile _T("C://MobileGame//Money.ini") //金币记录
//#define TaskSpeedFile _T("C://MobileGame//每日任务进度.ini")
//#define ChengHaoStateFile _T("C://MobileGame//成号状态.ini")
//
//extern CLuck g_cLuck;
//extern CIniFile g_IniFile;
//extern CIniFile g_AccountFile;
//extern CIniFile g_RoleNameFile;
//extern CIniFile g_MoneyFile;
//extern CIniFile g_TaskSpeedFile;
//extern CIniFile g_ChangHaoStateFile;//成号状态
//
//
//
//extern CString m_SimulatorPath;
//extern  CString g_Dnplayer2Path;
//
//extern Cdmsoft *m_GlobalDM;//全局大漠
//extern Cdmsoft *m_DM[20];
//
//extern CString m_SimulatorPath;
//extern CString g_Dnplayer2Path;
//extern CString g_strDesktopPath;
//
//extern CIniFile g_IniFile;
//extern CIniFile g_AccountFile;
//extern CIniFile g_RoleNameFile;
//extern CIniFile g_MoneyFile;
//extern CIniFile g_TaskSpeedFile;
//extern CIniFile g_ChangHaoStateFile;//成号状态
//
//
//
//extern ScriptSetupInfo m_ScriptSet[20];
//
//
//CString NumberToString(LONG Number);
//
////创建一个目录
//BOOL CreateDir(CString P);
//
////分割字符串
//void StringSplit(CString source, CStringArray& dest, char division);
//
//DWORD RandomNumber(DWORD dwNumber1, DWORD dwNumber2);
//
//DWORD WINAPI StartScript(LPVOID lParam);
//

bool FindCol(OcrDetail ocrDetail);
bool FindMulCol(OcrDetail ocrDetail);
bool CmpCol(OcrDetail ocrDetail);
bool FindPic(OcrDetail ocrDetail);
bool FindStr(OcrDetail ocrDetail);

bool dmClick(OcrDetail ocrDetail);
bool dmDoubleClick(OcrDetail ocrDetail);
bool dmSlide(OcrDetail ocrDetail);
bool dmContinued(OcrDetail ocrDetail);

bool ocrType(OcrDetail ocrDetail);
bool Continued(OcrDetail ocrDetail);
bool ContinuedAction(int type, CString str);